package cn.itsource.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;

/**
 * 实体类：文章Article
 */
@Data
@Document(collection = "t_article")
public class Article {
    @Id
    private String _id;//对应mongodb的主键
    private Long id; //Mysql主键ID
    private String articlePic; //文章封面
    private String articleName; //文章名称
    private String articleTag; //文章标签
    private Long articleType; //文章类型ID
    private Integer articleState; //文章状态
    private Integer topState; //是否置顶
    private Long publishId; //发布人ID
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date createTime = new Date(); //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") //局部时间格式化
    private Date updateTime; //修改时间
    private Integer articleReadCount = 0; //阅读量
    private Integer articleStarNum = 0; //点赞数
    private Integer articleCommentNum = 0; //评论数
    private String articleRemark; //备注
    private String articleContent; //文章内容

    //搞字符串可以用自动映射
    private String publishName;//保存作者名称
    private String typeName;//保存文章类型的名称
}
